import { request } from "./ApiManage";
import { TASK_LIST } from "./apiurl";
import Config from "./Config";

export function getTaskList({ page = 1, row = 10, wfid = "", query = '' }) {
	return request(TASK_LIST, {
		page: page,
		row: row,
		wfid: wfid,
		query: query,
		fromDevice: 'mobile'
	})
}

export function getHasDoIndex({ page = 1, row = 10, wfid = "", query = '' }) {
	return request(Config.HAS_DO_INDEX, {
		page: page,
		row: row,
		wfid: wfid,
		query: query,
		fromDevice: 'mobile'
	})
}

export function getBoxList({ INSTANCEID = '', QUERY = '' }) {
	return request(Config.QUERY_URL, {
		apiTag: 'J_',
		apiNo: 'API2021000005',
		INSTANCEID: INSTANCEID,
		QUERY: QUERY
	})
}

export function updateBoxStatus({ ID, ZT }) {
	return request(Config.SYS_PUBLIC_POST, {
		p_url: 'sys_api_update.action',
		apiTag: 'J_',
		apiNo: 'API2021000004',
		ID: ID,
		ZT: ZT
	})
}

export function addBox({ INSTANCEID, XH, PBH, CH }) {
	return request(Config.SYS_PUBLIC_POST, {
		apiNo: 'API2021000006',
		apiTag: 'J_',
		p_url: 'sys_api_add.action',
		INSTANCEID,
		XH,
		PBH,
		CH
	})
}


export function getBusinessList({ INSTANCEID = '', QUERY = '' }) {
	return request(Config.SYS_PUBLIC_POST, {
		p_url: 'sys_api_query.action',
		apiTag: 'J_',
		apiNo: 'API2021000007',
		instanceId: INSTANCEID,
		query: QUERY
	})
}


export function updateFCStatus({ ID, ZT, instanceId, fyrq, xcr }) {
	return request(Config.SYS_PUBLIC_POST, {
		p_url: 'sys_api_add.action',
		apiTag: 'J_',
		apiNo: 'API2021000001',
		id: ID,
		fczt: ZT,
		instanceId,
		fyrq,
		xcr
	})
}


export function getReturnList({ INSTANCEID = '', QUERY = '' }) {
	return request(Config.SYS_PUBLIC_POST, {
		p_url: 'sys_api_query.action',
		apiTag: 'J_',
		apiNo: 'API2021000008',
		instanceId: INSTANCEID,
		query: QUERY
	})
}


export function updateReturnStatus({ ID, sffk }) {
	return request(Config.SYS_PUBLIC_POST, {
		p_url: 'sys_api_add.action',
		apiTag: 'J_',
		apiNo: 'API2021000009',
		id: ID,
		sffk,
	})
}
